package com.yuyou.tas.feedback.service.impl;

import com.yuyou.tas.feedback.mapper.FeedbackCommentMapper;
import com.yuyou.tas.feedback.service.IFeedbackCommentService;
import com.yuyou.tas.service.api.feedback.dto.FeedbackCommentDTO;
import com.yuyou.tas.service.api.feedback.entity.FeedbackComment;
import com.yuyou.tas.service.api.feedback.vo.resp.UnReadSimpleVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FeedbackCommentServiceImpl implements IFeedbackCommentService {

    @Autowired
    private FeedbackCommentMapper mapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return mapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(FeedbackComment record) {
        return mapper.insert(record);
    }

    @Override
    public FeedbackComment selectByPrimaryKey(Long id) {
        return mapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(FeedbackComment record) {
        return mapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public List<FeedbackComment> findByFeedbackClassId(Long feedbackClassId) {
        return mapper.findByFeedbackClassId(feedbackClassId);
    }

    @Override
    public List<FeedbackCommentDTO> findFeedbackCommentList(Long feedbackId) {
        return mapper.findFeedbackComment(feedbackId);
    }

    @Override
    public Integer getTeacherUnReadCount(Long userId) {
        return mapper.getTeacherUnReadCount(userId);
    }

    @Override
    public List<UnReadSimpleVo> getTeacherClassUnReadCount(Long userId, List<Long> list) {
        return mapper.getTeacherClassUnReadCount(userId , list);
    }

    @Override
    public void setIsReadByFeedback(Long feedbackId) {
        mapper.setIsReadByFeedback(feedbackId);
    }
}